﻿using Microsoft.VisualBasic.FileIO;
using System.IO;

namespace CommonUtils
{
    /// <summary>
    /// 文件夹处理
    /// </summary>
    public static class FrameworkFolderUtil
    {
        /// <summary>
        /// 删除文件夹到回收站
        /// </summary>
        public static void DeleteToRecycleBin(string path)
        => FileSystem.DeleteDirectory(path, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);

        /// <summary>
        /// 删除文件夹到回收站
        /// </summary>
        public static void DeleteToRecycleBin(this DirectoryInfo folder)
        => DeleteToRecycleBin(folder.FullName);
    }
}
